<?php
//exit('21321');
error_reporting(E_ALL ^E_NOTICE);
class IndexAction extends Action {
    function init() {
        //print_r($_COOKIE);
	//print_r(get_included_files());
    }
    
    public function index() {
	function test($args, $dd) {
	    throw new Exception;
	}


	try {
	    $a = 'sssd43424';
	    $b = 'hjehwrh';
	    test($a, $b);
	    //throw new Exception;
	} catch(Exception $e) {
	    $traceArr = $e->getTrace();
	    print_r($traceArr);
	    $traceArr = array_reverse($traceArr);
	    echo '<br>';
	    foreach ($traceArr as $key=>$value) {
		if (!isset($value['file']) && isset($value['class'])){
		    $reflector = new ReflectionClass($value['class']);
		    $value['file'] = $reflector->getFileName();
		    $value['line'] = $reflector->getStartLine();
		    //$reflectorFunction = new ReflectionFunctionAbstract($value['function']);
		    //$value['line'] = $reflectorFunction->getStartLine();
		    //print_r($reflector->getMethod($value['function']));
		}
		echo $key+1 .":" .$value['file'].'<br>';
		echo $value['class'].$value['type'].$value['function'].'<br>';
		print_r($value['args']).'<br>';
		$file = @file($value['file']);
		echo '<pre>';
		echo '<div style="background:gray;">';
		echo $file[$value['line']-2].'<br>';
		echo '<strong>'.$file[$value['line']-1].'</strong><br>';
		echo $file[$value['line']].'<br>';
		echo $file[$value['line']+1].'<br>';
		echo $file[$value['line']+2].'<br>';
		echo '</div>';
		echo '</pre>';
		unset($file);
	    }
	}
	//print_r($_POST);
        print_r($_GET);
        //print_r($_COOKIE);
        echo '<hr>';
        $testObj = new TestModel();
        $userArr = $testObj->getUser();
        $testArr = $testObj->select(1);
        print_r($userArr);
        print_r($testArr);
    }
}